/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package main.java.cn.webrx;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;

/**
 * <p>Project: jse2204 - File2
 * <p>Powered by webrx On 2022-09-21 16:46:52
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class File2 {
    public static void main(String[] args) throws Exception {
        File file  = new File("c.txt");
        //字节流
        FileInputStream fis = new FileInputStream(file);
        System.out.println(new String(fis.readAllBytes()));

        //字符流
        FileReader reader = new FileReader(file);
        BufferedReader br = new BufferedReader(reader);
        while(br.ready()){
            System.out.println(br.readLine());
        }
    }
}
